package com.ylesb.ioc.javaconfig;
/**
 * @title: JavaConfig
 * @projectName springdemo
 * @description: TODO
 * @author White
 * @site : [www.ylesb.com]
 * @date 2022/7/710:21
 */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @className    : JavaConfig
 * @description  : [javaconfig 类似于applicationContext.xml]
 * @author       : [XuGuangchao]
 * @site         : [www.ylesb.com]
 * @version      : [v1.0]
 * @createTime   : [2022/7/7 10:21]
 * @updateUser   : [XuGuangchao]
 * @updateTime   : [2022/7/7 10:21]
 * @updateRemark : [描述说明本次修改内容] 
 */
@Configuration
@ComponentScan(basePackages = {"com.ylesb.ioc"})//添加扫描具体包 如果加了@service等就会被扫描，不加默认扫描本类所在的包
public class JavaConfig {
    //@Bean
    @Bean("sh")//获取的时候就是需要填sh
    SayHello sayHello()
    {
       return new SayHello();
    }

}
